import java.util.Arrays;

public class Tester {

	public static void main(String[] args) {
		TransitionTable t = new TransitionTable(2);
		State[] row = new State[3];
//		row[0] = new State("A", 0);
//		row[1] = new State("B", 1);
//		row[2] = new State("C", 0);
//		t.addRow(row);
//		row[0] = new State("B", 0);
//		row[1] = new State("A", 1);
//		row[2] = new State("C", 1);
//		t.addRow(row);
//		row[0] = new State("C", 0);
//		row[1] = new State("A", 0);
//		row[2] = new State("B", 0);
//		t.addRow(row);
		/**Example**/
		row[0] = new State("A");
		row[1] = new State("C", 1);
		row[2] = new State("E", 1);
		t.addRow(row);
		row[0] = new State("B");
		row[1] = new State("A", 0);
		row[2] = new State("D", 1);
		t.addRow(row);
		row[0] = new State("C");
		row[1] = new State("E", 0);
		row[2] = new State("D", 1);
		t.addRow(row);
		row[0] = new State("D");
		row[1] = new State("F", 1);
		row[2] = new State("A", 1);
		t.addRow(row);
		row[0] = new State("E");
		row[1] = new State("B", 1);
		row[2] = new State("F", 0);
		t.addRow(row);
		row[0] = new State("F");
		row[1] = new State("B", 1);
		row[2] = new State("C", 1);
		t.addRow(row);
		/**anther example**/
//		row[0] = new State("A");
//		row[1] = new State("B", 0);
//		row[2] = new State("D", 0);
//		t.addRow(row);
//		row[0] = new State("B");
//		row[1] = new State("A", 0);
//		row[2] = new State("B", 0);
//		t.addRow(row);
//		row[0] = new State("C");
//		row[1] = new State("D", 1);
//		row[2] = new State("A", 0);
//		t.addRow(row);
//		row[0] = new State("D");
//		row[1] = new State("D", 1);
//		row[2] = new State("C", 0);
//		t.addRow(row);

		// long time = System.currentTimeMillis();
//		 System.out.println(Arrays.toString(SolutionTree.createSolutionTree(2,
//		 t).solveSCP("A", "B")));
		// System.out.println((System.currentTimeMillis()-time));
//		System.out.println(Arrays.toString(SolutionTree
//				.createSolutionTree(2, t).solveSynchronize()));
		String[][] s = SolutionTree
				.createSolutionTree(2, t).solveISIP();
		System.out.println(Arrays.toString(s));
		
//		System.out.println(Arrays.toString(SolUTIONTREE
//				.CREATESOLUTIONTREE(2, T).SOLVeISIP()));
		//
		// TreeMap<String, State> t1 = new TreeMap<String, State>();
		// t1.put("B", new State("B"));
		// TreeMap<String, State> t2 = new TreeMap<String, State>();
		// t2.put("B", new State("B"));
		// System.out.println(t1.entrySet().hashCode());
		// System.out.println(t2.entrySet().hashCode());
	}
}
